package com.treeman.navi.login;



public class ApiRequestError {

	public enum ApiError {
		/**
		 * Requested resource not found
		 */
		NOT_FOUND,
		/**
		 * No permission.
		 */
		NO_PERMISSION,
		/**
		 * No permissions. Required role: {@link Role.USER}
		 */
		NO_PERMISSION_USER,
		/**
		 * No permissions. Required role: {@link Role.PREMIUM_USER}
		 */
		NO_PERMISSION_PREMIUM,
		/**
		 * No permissions. Required role: {@link Role.SUPER_USER}
		 */
		NO_PERMISSION_ADMIN,

		INVALID_ACCESS_TOKEN,

		INVALID_USERNAME_OR_PASSWORD,
		/**
		 * User is already logged in.
		 */
		ALREADY_LOGGED,

		NOT_LOGGED,

		MISSING_REQUEST_PARAMS,

		INTERNAL_ERROR,
		
		CONNECTION_TIMEOUT
	}

	public ApiRequestError(ApiError error, String reason) {
		this.error = error;
		this.reason = reason;
	}

	private String reason;

	private ApiError error;

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public ApiError getError() {
		return error;
	}

	public void setError(ApiError error) {
		this.error = error;
	}

}
